/**
 * 
 */
package Annotaiton;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author sz
 *
 * create time：2012-7-16
 */
public class test {
	public static void main(String[] args){
		
		D d= new D();
		
		Class clazz = d.getClass();
		
		Zhu zu =   (Zhu) clazz.getAnnotation(Zhu.class);
		
		System.out.println(zu.name());
		
		System.out.println(zu.clazz());
	}
}

@Zhu(name = "xiaozhu",clazz= D.class)
class D{
	private String name;

}

@Target(ElementType.TYPE)
@Retention( RetentionPolicy.RUNTIME)
@interface Zhu{
	String name();
	
	Class clazz();
}